﻿<%@ Page Title="Fleet" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Aircrafts.aspx.cs" Inherits="IFD2.Aircrafts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Aircraft Type:" meta:resourcekey="AircraftType"></asp:Label>
                <asp:DropDownList ID="lstAcTypes" cssclass="form-control input-sm" runat="server" DataSourceID="sqlAcTypes" DataTextField="ac_type" DataValueField="ac_type"></asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <asp:Button ID="btnLogs" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" Text="Logs..." PostBackUrl="AircraftLog.aspx"  meta:resourcekey="Logs"/>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:SqlDataSource ID="sqlAcTypes" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                SelectCommand="bll_aircraft_get_types" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
            </asp:SqlDataSource>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:500px;" class="table-hover"
                            DataKeyNames="tail_no" DataSourceID="sqlPlaneList" ForeColor="#333333" GridLines="None">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:BoundField DataField="ac_type" HeaderText="ac_type" SortExpression="ac_type"  meta:resourcekey="ac_type" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <input name="KEY" type="radio" value='<%# Eval("tail_no") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="tail_no" HeaderText="tail_no" ReadOnly="True" SortExpression="tail_no"  meta:resourcekey="tail_no" />
                                <%--<asp:BoundField DataField="surcharge_type" HeaderText="surcharge_type" SortExpression="surcharge_type"  meta:resourcekey="surcharge_type" />--%>
                                <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                    <div class="btn-group">
                        <asp:Button ID="btnCabins" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnCabins_Click" Text="Cabins..."  meta:resourcekey="Cabins" />
                        <asp:Button ID="btnSeats" runat="server" CssClass="btn btn-sm btn-default" Text="Seat Map..." OnClick="btnSeats_Click"  meta:resourcekey="SeatMap" />
                        <asp:Button ID="btnDelete" runat="server" CssClass="btn btn-sm btn-default" Text="Delete" OnClick="btnDelete_Click"  meta:resourcekey="Delete" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
                    <br />
                    <div class="well well-sm">
                        <asp:Label ID="Label2" runat="server" Text="New Aircraft" Font-Bold="True" meta:resourcekey="NewAircraft"></asp:Label>
                        <br />
                        <div class="form-group">
                        <asp:Label ID="Label3" runat="server" Text="Tail Number:" meta:resourcekey="TailNumber"></asp:Label>
                        <asp:TextBox ID="txtTailNo" runat="server" Width="71px" MaxLength="8"></asp:TextBox>
                        <asp:Label ID="Label4" runat="server" Text="[Tail number starting with '*' is a virtual plane !]" meta:resourcekey="Note"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </div>
                        <br class="hidden-xs"/>
                        <%--<div class="form-group">
                        <asp:Label ID="Label5" runat="server" Text="Surcharge type:" meta:resourcekey="SurchargeType"></asp:Label>
                        <asp:DropDownList ID="lstSurchargeTypes" runat="server">
                            <asp:ListItem Selected="True" Value="*">*(System Default)</asp:ListItem>
                            <asp:ListItem Value="1">1 [Cheapest]</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem Value="5">5 [Midium]</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem Value="9">9 [Most Expensive]</asp:ListItem>
                        </asp:DropDownList>
                        </div>--%>
                        <br class="hidden-xs" />
                        <asp:Button ID="btnAdd" runat="server" CssClass="btn btn-sm btn-default" Text=" Add " OnClick="btnAdd_Click"  meta:resourcekey="Add" />
                    </div>

                    <asp:SqlDataSource ID="sqlPlaneList" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                        SelectCommand="bll_aircraft_get_by_type" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lstAcTypes" Name="ac_type" PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </div>
            </div>
        </div>
    </div>

    </div></form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ScrollHeight:tab_new_height});
        });
    </script>

</asp:Content>
